using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;

namespace ERPBackend.Models
{
    public class PurchaseStockIn : BaseModel
    {
        [Required]
        [MaxLength(50)]
        public string StockInCode { get; set; }

        public int PurchaseOrderId { get; set; }

        [ForeignKey("PurchaseOrderId")]
        public virtual PurchaseOrder PurchaseOrder { get; set; }

        public int SupplierId { get; set; }
    public virtual Supplier Supplier { get; set; }

        public int WarehouseId { get; set; }

        [ForeignKey("WarehouseId")]
        public virtual Warehouse Warehouse { get; set; }

        [Required]
        public DateTime StockInDate { get; set; }

        public decimal TotalQuantity { get; set; }

        public decimal TotalAmount { get; set; }

        [Required]
        [MaxLength(50)]
        public string Status { get; set; }

        public int? ApprovedBy { get; set; }

        public DateTime? ApprovedTime { get; set; }

        public string Remark { get; set; }

        public virtual ICollection<PurchaseStockInItem> PurchaseStockInItems { get; set; }
    }
}